<template>
  <div :class="[{ 'is-active': isActive }]" @click="toggleClick">
    <svg-icon name="hamburger" width="20" height="20" style="fill: #fff;" />
  </div>
</template>

<script lang="ts">
// slibar 菜单折叠按钮
import { Component, Emit, Prop, Vue } from "vue-property-decorator";

@Component({
  name: "Hamburger"
})
export default class extends Vue {
  @Prop({ default: false }) private isActive!: boolean; //是否打开菜单
  @Emit()
  private toggleClick() {
    return this.isActive;
  }
}
</script>

<style lang="less" scoped>
.svg-icon {
  vertical-align: middle;
}

.is-active {
  transform: rotate(180deg);
}
</style>
